export function dict () {
    return {
        YesOrNo: [
            { name: '否', value: 0 },
            { name: '是', value: 1 }
        ],
        SexType: [
            { name: '女', value: '0' },
            { name: '男', value: '1' }
        ],
        Deposit: [
            { name: '未押金', value: '0' },
            { name: '已押金', value: '1' },
            { name: '已退还', value: '2' }
        ],
        MenuType: [
            { name: '菜单', value: 'MENU' },
            { name: '按钮', value: 'BTN' },
            { name: '功能', value: 'FUNCTION' }
        ],
        ModelType: [
            { name: '底布', value: '底布' },
            { name: '面布', value: '面布' },
            { name: '原料', value: '原料' }
        ],
        Currency: [
            { name: '人民币', value: '人民币' },
            { name: '美元', value: '美元' }
        ],
        PayType: [
            { name: '预付款', value: 'ADVANCE' },
            { name: '正常付款', value: 'NORMAL' },
            { name: '对账单结算', value: 'BILL' }
        ],
        Unit: [
            { name: '米', value: '米' },
            { name: '千克', value: '千克' },
            { name: '个', value: '个' },
            { name: '只', value: '只' },
            { name: '把', value: '把' },
            { name: '克', value: '克' },
            { name: '千米', value: '千米' },
            { name: '卷', value: '卷' }
        ],
        BusinessType: [
            { name: '入库', value: 'IN' },
            { name: '出库', value: 'OUT' }
        ],
        WmsOrderStatus: [
            { name: '未操作', value: 'UN_DO' },
            { name: '已操作', value: 'DO' },
            { name: '已作废', value: 'INVALID' },
            { name: '已取消', value: 'CANCEL' }
        ],
        BusinessOrderStatus: [
            { name: '未审核', value: 'UN_CHECK' },
            { name: '未出入库', value: 'UN_DO' },
            { name: '已取消', value: 'CANCEL' },
            { name: '已完成', value: 'FINISH' }
        ],
        OrderStatus: [
            { name: '审核中', value: 'CHECKING' },
            { name: '审核通过', value: 'PASS' },
            { name: '已取消', value: 'CANCEL' },
            { name: '生产中', value: 'PROD' },
            { name: '已完成', value: 'FINISH' }
        ],
        PurchaseInOrderStatus: [
            { name: '未审核', value: 'UN_CHECK' },
            { name: '未入库', value: 'UN_IN' },
            { name: '已取消', value: 'CANCEL' },
            { name: '已完成', value: 'FINISH' }
        ],
        PurchaseOrderStatus: [
            { name: '未审核', value: 'UN_CHECK' },
            { name: '已审核', value: 'CHECKED' },
            { name: '已取消', value: 'CANCEL' },
            { name: '已完成', value: 'FINISH' }
        ],
        SaleOutOrderStatus: [
            { name: '未审核', value: 'UN_CHECK' },
            { name: '未出库', value: 'UN_OUT' },
            { name: '已取消', value: 'CANCEL' },
            { name: '已完成', value: 'FINISH' }
        ],
        SaleOrderStatus: [
            { name: '未审核', value: 'UN_CHECK' },
            { name: '已审核', value: 'CHECKED' },
            { name: '已取消', value: 'CANCEL' },
            { name: '已完成', value: 'FINISH' }
        ],
        TemplateType: [
            { name: '客户', value: 'CUSTOMER' },
            { name: '工艺', value: 'TECH' }
        ],
        CustomerType: [
            { name: '客户', value: 'CUSTOMER' },
            { name: '供应商', value: 'SUPPLIER' },
            { name: '加工企业', value: 'HANDLE' }
        ],
        BillStatus: [
            { name: '未审核', value: 'UN_CHECK' },
            { name: '已审核', value: 'PASS' },
            { name: '已取消', value: 'CANCEL' },
            { name: '已确认', value: 'FINISH' },
            { name: '已完成', value: 'SETTLEMENT' },
            { name: '已结清', value: 'CLEAN' }
        ],
        BillSource: [
            { name: '加工单', value: 'BUSINESS' },
            { name: '采购单', value: 'PURCHASE' },
            { name: '销售单', value: 'SALE' },
            { name: '订单', value: 'ORDER' }
        ],
        CustomerLabel: [
            { name: '烂花厂', value: '烂花厂' },
            { name: '砂洗厂', value: '砂洗厂' },
            { name: '加工厂', value: '加工厂' },
            { name: '植绒布供应商', value: '植绒布供应商' },
            { name: '复合布供应商', value: '复合布供应商' },
            { name: '底布厂', value: '底布厂' },
            { name: '印花纸', value: '印花纸' },
            { name: '压胶厂', value: '压胶厂' },
            { name: '植绒厂', value: '植绒厂' },
            { name: '半成品检验车间', value: '半成品检验车间' },
            { name: '成品检验车间', value: '成品检验车间' },
            { name: '复合厂', value: '复合厂' },
            { name: '压花厂', value: '压花厂' },
            { name: '纱线供应商', value: '纱线供应商' },
            { name: '烫金厂', value: '烫金厂' },
            { name: '造筒厂', value: '造筒厂' },
            { name: '样本厂', value: '样本厂' },
            { name: '花本厂', value: '花本厂' },
            { name: '杂厂', value: '杂厂' },
            { name: '整经车间', value: '整经车间' },
            { name: '成品车间', value: '成品车间' },
            { name: '织造厂', value: '织造厂' },
            { name: '拉毛定型厂', value: '拉毛定型厂' },
            { name: '绣花厂', value: '绣花厂' },
            { name: '染厂', value: '染厂' }
        ],
        DataAuth: [
            { name: '全部', value: 'ALL' },
            { name: '集团', value: 'GROUP_COMPANY' },
            { name: '公司', value: 'COMPANY' },
            { name: '部门', value: 'ORG' },
            { name: '个人', value: 'PERSON' }
        ]
    }
}


export function PayTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().PayType
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function UnitTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().Unit
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function CurrencyTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().Currency
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function CustomerTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().CustomerType
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function TemplateTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().TemplateType
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function BillSourceFormatter (row, col, value) {
    let rValue = value
    var list = dict().BillSource
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function BillStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().BillStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function BusinessOrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().BusinessOrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function OrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().OrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function SaleOutOrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().SaleOutOrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function SaleOrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().SaleOrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

export function PurchaseInOrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().PurchaseInOrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function PurchaseOrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().PurchaseOrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function WmsOrderStatusFormatter (row, col, value) {
    let rValue = value
    var list = dict().WmsOrderStatus
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function BusinessTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().BusinessType
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function MenuTypeFormatter (row, col, value) {
    let rValue = value
    var list = dict().MenuType
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}



export function YesOrNoFormatter (row, col, value) {
    let rValue = value
    var list = dict().YesOrNo
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}


export function DataAuthFormatter (row, col, value) {
    let rValue = value
    var list = dict().DataAuth
    list.forEach(function (li) {
        if (li.value === value) {
            rValue = li.name
        }
    })
    return rValue
}

